/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.ejb.persistencia;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author MoisesAntonio
 */
@Entity
@Table(name = "xmljuego")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Xmljuego.findAll", query = "SELECT x FROM Xmljuego x"),
    @NamedQuery(name = "Xmljuego.findByIdXml", query = "SELECT x FROM Xmljuego x WHERE x.idXml = :idXml")})
public class Xmljuego implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "IdXml")
    private Integer idXml;
    @Lob
    @Column(name = "info")
    private byte[] info;
    @Lob
    @Column(name = "juego")
    private byte[] juego;
    @JoinColumn(name = "CJuego", referencedColumnName = "IdJuego")
    @ManyToOne(optional = false)
    private Juegos cJuego;

    public Xmljuego() {
    }

    public Xmljuego(Integer idXml) {
        this.idXml = idXml;
    }

    public Integer getIdXml() {
        return idXml;
    }

    public void setIdXml(Integer idXml) {
        this.idXml = idXml;
    }

    public byte[] getInfo() {
        return info;
    }

    public void setInfo(byte[] info) {
        this.info = info;
    }

    public byte[] getJuego() {
        return juego;
    }

    public void setJuego(byte[] juego) {
        this.juego = juego;
    }

    public Juegos getCJuego() {
        return cJuego;
    }

    public void setCJuego(Juegos cJuego) {
        this.cJuego = cJuego;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idXml != null ? idXml.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Xmljuego)) {
            return false;
        }
        Xmljuego other = (Xmljuego) object;
        if ((this.idXml == null && other.idXml != null) || (this.idXml != null && !this.idXml.equals(other.idXml))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.ejb.persistencia.Xmljuego[ idXml=" + idXml + " ]";
    }
    
}
